//
//  Singlecolltiongviecell.m
//  Feel_at_home
//
//  Created by 王静雨 on 15/9/24.
//  Copyright © 2015年 Feel_at_home. All rights reserved.
//

#import "Singlecolltiongviecell.h"
#define Height [UIScreen mainScreen].bounds.size.height
#define Width [UIScreen mainScreen].bounds.size.width


@implementation Singlecolltiongviecell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageview = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imageview];
        self.name = [[UILabel alloc] init];
        [self.contentView addSubview:self.name];
        self.money = [[UILabel alloc] init];
        self.price = [[UILabel alloc ]init];
        [self.contentView addSubview:self.price];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super layoutSubviews];
    self.imageview.frame = CGRectMake(0, 0, self.frame.size.width , self.frame.size.height-40);
    
    self.layer.cornerRadius = 5;
    self.layer.masksToBounds = YES;
    self.name.frame = CGRectMake(5*Width/375, 120*Height/667, (self.frame.size.width - 10)*Width/375, 40*Height/667);
    self.name.textColor = [UIColor colorWithRed:0.336 green:0.343 blue:0.289 alpha:1.000];
    self.name.font = [UIFont systemFontOfSize:11];
    self.name.numberOfLines = 0;
    self.price.frame = CGRectMake(115*Width/375, 140*Height/667, (self.frame.size.width / 2 - 10)*Width/375 , 30*Height/667);
    self.price.textColor = [UIColor colorWithRed:0.515 green:0.260 blue:0.415 alpha:1.000];
    self.price.font = [UIFont systemFontOfSize:10];
    self.money.frame = CGRectMake(30, 70, self.frame.size.width / 2, 30);
    
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
